# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=ajpfuzzer
pkgver=0.6
pkgrel=3
pkgdesc='A command-line fuzzer for the Apache JServ Protocol (ajp13).'
groups=('blackarch' 'blackarch-fuzzer')
arch=('any')
url='https://github.com/doyensec/ajpfuzzer'
license=('custom:unknown')
depends=('java-environment')
makedepends=('git')
noextract=("${pkgname}_v${pkgver}.jar")
source=("https://github.com/doyensec/ajpfuzzer/releases/download/v$pkgver/${pkgname}_v${pkgver}.jar")
sha512sums=('a28e00cac983c6eed5c48da1bb56b6c0a261a372de4ed7416f61a6b7282353bf5a438a1bbdee6b0f1d62479464e270a49f3f13b5d9bc6cc67b77b0731f17b37d')

package() {
  install -dm 755 "$pkgdir/usr/bin"

  install -Dm 644 "${pkgname}_v${pkgver}.jar" \
    "$pkgdir/usr/share/$pkgname/${pkgname}_v${pkgver}.jar"

  cat > "$pkgdir/usr/bin/$pkgname" << EOF
#!/bin/sh
exec java -jar /usr/share/$pkgname/${pkgname}_v${pkgver}.jar "\$@"
EOF

  chmod +x "$pkgdir/usr/bin/$pkgname"
}

